﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x020002F9 RID: 761
	public class TInsertIntoValue : TParseTreeNode
	{
		// Token: 0x17000602 RID: 1538
		// (get) Token: 0x06001AC1 RID: 6849 RVA: 0x0032E734 File Offset: 0x0032C934
		// (set) Token: 0x06001AC2 RID: 6850 RVA: 0x0032E73C File Offset: 0x0032C93C
		public virtual TTable Table
		{
			get
			{
				return this.table;
			}
			set
			{
				this.table = value;
			}
		}

		// Token: 0x17000603 RID: 1539
		// (get) Token: 0x06001AC3 RID: 6851 RVA: 0x0032E745 File Offset: 0x0032C945
		// (set) Token: 0x06001AC4 RID: 6852 RVA: 0x0032E74D File Offset: 0x0032C94D
		public virtual TObjectNameList ColumnList
		{
			get
			{
				return this.columnList;
			}
			set
			{
				this.columnList = value;
			}
		}

		// Token: 0x17000604 RID: 1540
		// (get) Token: 0x06001AC5 RID: 6853 RVA: 0x0032E756 File Offset: 0x0032C956
		// (set) Token: 0x06001AC6 RID: 6854 RVA: 0x0032E75E File Offset: 0x0032C95E
		public virtual TMultiTargetList TargetList
		{
			get
			{
				return this.targetList;
			}
			set
			{
				this.targetList = value;
			}
		}

		// Token: 0x06001AC7 RID: 6855 RVA: 0x0032E767 File Offset: 0x0032C967
		public override void init(object arg1)
		{
			this.fromTable = (TFromTable)arg1;
		}

		// Token: 0x06001AC8 RID: 6856 RVA: 0x0032E778 File Offset: 0x0032C978
		public override void init(object arg1, object arg2)
		{
			this.fromTable = (TFromTable)((TDummy)arg1).node1;
			if (((TDummy)arg1).node1 != null)
			{
				this.columnList = (TObjectNameList)((TDummy)arg1).node2;
			}
			if (arg2 != null)
			{
				this.targetList = (TMultiTargetList)((TDummy)arg2).list1;
			}
		}

		// Token: 0x06001AC9 RID: 6857 RVA: 0x0032E7D8 File Offset: 0x0032C9D8
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			this.table = psql.analyzeFromTable(this.fromTable, new bool?(true));
			if (this.columnList != null)
			{
				for (int i = 0; i < this.columnList.size(); i++)
				{
					TObjectName objectName = this.columnList.getObjectName(i);
					objectName.Location = ESqlClause.insertColumn;
					this.table.ObjectNameReferences.addObjectName(objectName);
					this.table.LinkedColumns.addObjectName(objectName);
					objectName.SourceTable = this.table;
				}
			}
			if (this.targetList != null)
			{
				this.targetList.doParse(psql, ESqlClause.insertValues);
			}
		}

		// Token: 0x06001ACA RID: 6858 RVA: 0x0032E874 File Offset: 0x0032CA74
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001ACB RID: 6859 RVA: 0x0032E884 File Offset: 0x0032CA84
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.table.acceptChildren(v);
			if (this.columnList != null)
			{
				this.columnList.acceptChildren(v);
			}
			if (this.targetList != null)
			{
				this.targetList.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x17000605 RID: 1541
		// (set) Token: 0x06001ACC RID: 6860 RVA: 0x0032E8D3 File Offset: 0x0032CAD3
		public virtual TFromTable FromTable
		{
			set
			{
				this.fromTable = value;
			}
		}

		// Token: 0x040019BC RID: 6588
		private TFromTable fromTable;

		// Token: 0x040019BD RID: 6589
		private TMultiTargetList targetList;

		// Token: 0x040019BE RID: 6590
		private TObjectNameList columnList;

		// Token: 0x040019BF RID: 6591
		private TTable table;
	}
}
